package com.neusoft.feign;

import com.neusoft.po.Cart;
import com.neusoft.po.CommonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

//指定调用的微服务名
@FeignClient(name="cart-server",fallback=CartFeignClientCallBack.class)
public interface CartFeignClient {
    @GetMapping("/CartController/listCart/{userId}/{businessId}")
    CommonResult<List<Cart>> listCart(
            @PathVariable("userId") String userId,
            @PathVariable("businessId") Integer businessId);

    @DeleteMapping("/CartController/removeCart/{userId}/{businessId}")
    public CommonResult<Integer> removeCart(
            @PathVariable("userId") String userId,
            @PathVariable("businessId") Integer businessId);
}